﻿using NUnit.Framework;

namespace OpenWaves.UnitTests
{
    [TestFixture]
    public class GetDisplayTextExtensionTests
    {
        [Test]
        public void When_enum_member_is_decorated_with_IDisplayTextProvider_GetDisplayText_returns_IDisplayTextProvider_Text()
        {
            Assert.AreEqual("Value 1 Display Text", MyEnum.Value1.GetDisplayText());
        }

        [Test]
        public void When_enum_member_is_NOT_decorated_with_IDisplayTextProvider_GetDisplayText_returns_enum_member_name()
        {
            Assert.AreEqual("Value2", MyEnum.Value2.GetDisplayText());
        }

        private enum MyEnum
        {
            [DisplayText("Value 1 Display Text")]
            Value1,
            Value2
        }         
    }
}